package com.yida.gwj.api.service;

import com.yida.common.core.constant.SecurityConstants;
import com.yida.common.core.constant.ServiceNameConstants;
import com.yida.common.core.domain.R;
import com.yida.gwj.api.domain.dto.GwjGVoteProjectStatisticsDataDTO;
import com.yida.gwj.api.domain.dto.GwjGVoteResultInnerDTO;
import com.yida.gwj.api.domain.request.GwjVoteResultInnerRequest;
import com.yida.gwj.api.factory.RemoteGwjVoteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 20230621 公维金投票服务
 *
 * @author lqq
 */
@FeignClient(contextId = "remoteGwjVoteService", value = ServiceNameConstants.GWJ_VOTE_SERVICE, fallbackFactory = RemoteGwjVoteFallbackFactory.class)
public interface RemoteGwjVoteService {

    /**
     * 公维金业务查询投票结果
     *
     * @param request 业务标识ID
     * @param source /
     * @return /
     */
    @PostMapping("/detail/g/voteResult")
    R<List<GwjGVoteResultInnerDTO>> innerVoteResult(@RequestBody GwjVoteResultInnerRequest request, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 公维金业务查询投票统计结果
     *
     * @param bizNum 业务编码
     * @param source /
     * @return /
     */
    @GetMapping("/project/inner/g/statistics/{bizNum}")
    R<GwjGVoteProjectStatisticsDataDTO> innerGVoteProjectStatistics(@PathVariable("bizNum") Long bizNum, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
